import React from 'react'
import { connect } from 'react-redux'

const ComA = (props) => {
    const handleClick=()=>{
        console.log(props);
        props.sendAction()
    }
    return (
        <div>
            <button onClick={handleClick}>+</button>
        </div>
    )
}
/**
 * 
 * @param {*} dispatch 
 * @returns Object
 */
const mapDispatchToProps = (dispatch) => {
    return {
        sendAction: () => {
            dispatch({
                type: 'add_action'

            })
        }
    }
}
// 发送方
export default connect(null, mapDispatchToProps)(ComA)
